<template>
  <Page :show-nav-bar="false" v-slot:default="{contentClass}" :style="'background-color: #c34b4b; background: url(' + bgHome + ') no-repeat; background-size: 100% auto;min-height:45.625rem;'">
    <div :class="contentClass" >
<!--      <div :style="'background: url(' + topLogo + ') no-repeat; background-size: 100% auto;width:20rem; height:1.56rem; margin: 0 auto;'"></div>text-shadow: 0px 4px 4px rgba(0, 0, 0, 0.25);-->
      <div>
        <div class="text-center rounded" style="width: 18.52rem; height: 14.22rem; margin: 0 auto; margin-top: 22rem; ">
          <div class="w-full rounded p-2 font-bold text-blue-700" style="background-image: linear-gradient(to right, #f7d8d0 , #f3b990);">
              中奖名单公布
          </div>
          <div class="w-full rounded p-2 font-bold bg-white ring-1 ring-slate-200 mt-3">
            <span class="text-red-700 font-bold">免单大奖：</span><span class="text-gray-500">黑桃k***~</span>
          </div>
          <div class="text-center text-xs text-gray-500 mt-5" style="line-height: 1.4rem; font-size: 0.85rem">
            <p>恭喜该中奖者</p>
            <p>工作人员将于2024年7月22日根据所留联系方式</p>
            <p>与中奖者对接，请保持电话畅通</p>
          </div>
        </div>
      </div>
    </div>
  </Page>
</template>

<script setup>
import bus from '../utils/bus'
import Page from "../components/Page.vue";
import XInput from '../components/XInput.vue'
import {computed, nextTick, onActivated, onMounted, ref} from "vue";
import apis from '../apis'
import {useStore} from "vuex";
import {useRoute, useRouter} from "vue-router";
import { ImagePreview } from 'vant';
import bgHome from '../assets/images/bg-home.jpg'
// import bgResult from '../assets/images/bg-result.png'
// import topLogo from '../assets/images/top-logo.png'

const store = useStore()
const router = useRouter()
const route = useRoute()

const user = computed(() => store.state.user)

const activity = ref(null)

const item = ref({
  name: null,
  mobile: null,
})

const mask = (mobile) => {
  if (!mobile) return ""
  const reg = /^(\d{3})(\d{4})(\d{4})$/
  return mobile.replace(reg, "$1****$2")
}

const onRefull = () => {
  let query = route.query
  query.rewrite = 1
  router.replace({name: 'home', query})
}

onMounted(() => {

  apis.activity.show({
    form_id: route.query.form_id
  }).then(({data: result}) => {
    activity.value = result.data
  })

  apis.activity.submitted({
    form_id: route.query.form_id
  }).then(({data: result}) => {
    if(result.data) {
      item.value = result.data
      // router.push({name: 'result', query: {form_id: route.query.form_id}})
      // window.location.href = 'http://localhost:3002/coupons/frame?id=1'
      // window.location.href = 'http://localhost:3000/mine/coupons'
      // if (result.data.verify == 1) {
      //   window.location.href = 'http://member.yishidekeji.com/mine/coupons'
      // }
    }
  })

})


const to = (url) => {
  window.location.href = url
}

</script>

<style scoped>

</style>